home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-10-09 | 11.8 KB | 696 lines | [TEXT/MPS ] |
- // Test.r
-
- // • Auto-Include the requirements for this source
- #ifndef __TYPES.R__
- #include "Types.r"
- #endif
-
- #ifndef __MacAppTypes__
- #include "MacAppTypes.r"
- #endif
-
- #ifndef __ViewTypes__
- #include "ViewTypes.r"
- #endif
-
- #if qDebug
- include "Debug.rsrc";
- #endif
- include "MacApp.rsrc";
- include "Dialog.rsrc";
- include "Printing.rsrc";
- include "SplashPict.rsrc"; // Picture displayed in the Splash dialog
-
- // Grab lots of resources from Apple's defaults, except those noted below, which
- // were removed from a copy of Apple's 'Defaults.rsrc' file
- include "MacAppDefaults.rsrc";
-
- include $$Shell("ObjApp")"Test" 'CODE';
-
- // new stuff
- #define cEnterDateTime 3000 // Command to enter new date/time
- #define mDateTime 4 // DateTime menu
- #define kDialogWindowID 2001 // dialog window
- #define kDialogViewID 2002 // dialog view
- #define kSplash 3001 // splash dialog
-
- // Only our DateTime menu is defined here; all other menus are taken from MacApp
- resource 'cmnu' (mDateTime) {
- mDateTime,
- textMenuProc,
- 0x00000001,
- enabled,
- "DateTime",
- {
- /* [1] */
- "Enter Date or Time…",
- noIcon, "E", noMark, plain, cEnterDateTime;
- }
- };
-
- // this resource replaces one deleted from the MacAppDefaults.rsrc
- resource 'MBAR' (kMBarDisplayed) {
- {mApple; mFile; mEdit; mDateTime}
- };
-
-
- // popup menus
- resource 'MENU' (2001) {
- 2001,
- textMenuProc,
- 0x0000000F,
- enabled,
- "Object: ",
- { /* array: 4 elements */
- /* [1] */
- "shortDate", noIcon, noKey, noMark, plain;
- /* [2] */
- "longDate", noIcon, noKey, noMark, plain;
- /* [3] */
- "abbrevDate", noIcon, noKey, noMark, plain;
- /* [4] */
- "defDateForm", noIcon, noKey, noMark, plain
- }
- };
-
- resource 'MENU' (2002) {
- 2002,
- textMenuProc,
- 0x00000007,
- enabled,
- "Global: ",
- { /* array: 4 elements */
- /* [1] */
- "shortDate", noIcon, noKey, noMark, plain;
- /* [2] */
- "longDate", noIcon, noKey, noMark, plain;
- /* [3] */
- "abbrevDate", noIcon, noKey, noMark, plain
- }
- };
-
-
- /*********************************************************************************
- The following resources define the application's "about…" box. The
- corresponding resources were delected from MacAppDefaults.rsrc.
- *********************************************************************************/
-
- resource 'ALRT' (phAboutApp, purgeable) {
- {40, 40, 238, 438},
- phAboutApp,
- { /* array: 4 elements */
- /* [1] */
- OK, visible, silent,
- /* [2] */
- OK, visible, silent,
- /* [3] */
- OK, visible, silent,
- /* [4] */
- OK, visible, silent
- }
- };
-
- resource 'DITL' (phAboutApp, "AboutBox", purgeable) {
- { /* array DITLarray: 2 elements */
- /* [1] */
- {164, 224, 184, 284},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {10, 10, 188, 364},
- Picture {
- disabled,
- kSplash
- }
- }
- };
-
-
- /*********************************************************************************
- The following resources define the Date/Time definition dialog. It must use
- standard resources (ie., not 'view' resources) because it is displayed before
- MacApp has been initialized.
-
- The 'PICT' resource is included froma resource file. Displaying a bunch of
- derezzed hex doesn't tell anybody anything, anyway.
- *********************************************************************************/
-
- resource 'DLOG' (kSplash, "Splash", purgeable, preload) {
- {40, 40, 238, 438},
- dBoxProc,
- visible,
- noGoAway,
- 0x0,
- kSplash,
- ""
- };
-
- resource 'DITL' (kSplash, "Splash", purgeable, preload) {
- { /* array DITLarray: 1 elements */
- /* [1] */
- {10, 10, 188, 364},
- Picture {
- disabled,
- kSplash
- }
- }
- };
-
-
- /*********************************************************************************
- The following 'view' resources define the Date/Time definition dialog.
- *********************************************************************************/
-
- resource 'view' (kDialogWindowID, "DateTimeTest Window", purgeable) {
- { /* array viewArray: 11 elements */
- /* [1] */
- root, 'wind',
- { /* array: 1 elements */
- /* [1] */
- 50, 40
- },
- { /* array: 1 elements */
- /* [1] */
- 200, 410
- }, sizeVariable, sizeVariable, shown, enabled,
- Window {
- "TWindow",
- dBoxProc,
- noGoAwayBox,
- notResizable,
- modal,
- ignoreFirstClick,
- freeOnClosing,
- disposeOnFree,
- closesDocument,
- openWithDocument,
- dontAdaptToScreen,
- dontStagger,
- dontForceOnScreen,
- center,
- 'DLOG',
- "<<<>>>"
- },
- /* [2] */
- 'wind', IncludeViews {kDialogViewID}
- }
- };
-
- resource 'view' (kDialogViewID, "DateTimeTest Dialog", purgeable) {
- { /* array viewArray: 11 elements */
- /* [1] */
- root, 'DLOG',
- { /* array: 1 elements */
- /* [1] */
- 0, 0
- },
- { /* array: 1 elements */
- /* [1] */
- 200, 410
- }, sizeVariable, sizeVariable, shown, enabled,
- DialogView {
- "TTestDialog",
- '_OK_',
- 'CNCL'
- },
- /* [3] */
- 'DLOG', 'help',
- { /* array: 1 elements */
- /* [1] */
- 10, 10
- },
- { /* array: 1 elements */
- /* [1] */
- 40, 385
- }, sizeFixed, sizeFixed, shown, disabled,
- StaticText {
- "TStaticText",
- 0b0,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {0, 0, 0, 0},
- plain,
- 9,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "A",
- justLeft,
- "Enter a date into the “Date” item, and a "
- "time into the “Time” item. Use the other "
- "controls to change the appearance and "
- "validation of the date and time."
- },
- /* [4] */
- 'DLOG', '_OK_',
- { /* array: 1 elements */
- /* [1] */
- 145, 320
- },
- { /* array: 1 elements */
- /* [1] */
- 28, 80
- }, sizeFixed, sizeFixed, shown, enabled,
- Button {
- "TButton",
- 0b1000000,
- {3, 3},
- sizeable,
- notDimmed,
- notHilited,
- dismisses,
- {4, 4, 4, 4},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- "OK"
- },
- /* [5] */
- 'DLOG', 'CNCL',
- { /* array: 1 elements */
- /* [1] */
- 115, 323
- },
- { /* array: 1 elements */
- /* [1] */
- 20, 74
- }, sizeFixed, sizeFixed, shown, enabled,
- Button {
- "TButton",
- 0b0,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- dismisses,
- {0, 0, 0, 0},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- "Cancel"
- },
- /* [6] */
- 'DLOG', 'date',
- { /* array: 1 elements */
- /* [1] */
- 95, 10
- },
- { /* array: 1 elements */
- /* [1] */
- 20, 50
- }, sizeFixed, sizeFixed, shown, disabled,
- StaticText {
- "TStaticText",
- 0b0,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {0, 0, 0, 0},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- justLeft,
- "Date:"
- },
- /* [7] */
- 'DLOG', 'time',
- { /* array: 1 elements */
- /* [1] */
- 125, 10
- },
- { /* array: 1 elements */
- /* [1] */
- 20, 50
- }, sizeFixed, sizeFixed, shown, disabled,
- StaticText {
- "TStaticText",
- 0b0,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {0, 0, 0, 0},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- justLeft,
- "Time:"
- },
- 'DLOG', 'DATE',
- { /* array: 1 elements */
- /* [1] */
- 92, 60
- },
- { /* array: 1 elements */
- /* [1] */
- 20, 235
- }, sizeFixed, sizeFixed, shown, enabled,
- DateEditText {
- "TDateEditText",
- 0b1111,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {2, 2, 2, 2},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- justLeft,
- "",
- 60,
- 0b11110000000000000000000100000000,
- laxValidation, // ignore non-fatal validation errors
- notRequired, // an empty string is OK
- kInvalidDateTimeAlert, // use the date-time error alert
- longDate // use long date format
- },
- /* [11] */
- 'DLOG', 'TIME',
- { /* array: 1 elements */
- /* [1] */
- 122, 60
- },
- { /* array: 1 elements */
- /* [1] */
- 20, 235
- }, sizeVariable, sizeVariable, shown, enabled,
- TimeEditText {
- "TTimeEditText",
- 0b1111,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {2, 2, 2, 2},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- justLeft,
- "",
- 60,
- 0b11110000000000000000000100000000,
- laxValidation, // ignore non-fatal validation errors
- notRequired, // an empty string is OK
- kInvalidDateTimeAlert, // use the date-time error alert
- dontWantSeconds // don't show seconds
- },
- /* [7] */
- 'DLOG', 'PClu',
- { /* array: 1 elements */
- /* [1] */
- 50, 10
- },
- { /* array: 1 elements */
- /* [1] */
- 40, 290
- }, sizeFixed, sizeFixed, shown, disabled,
- Cluster {
- "TCluster",
- 0b0,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {0, 0, 0, 0},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- "Date Forms"
- },
- /* [8] */
- 'PClu', 'pDAT',
- { /* array: 1 elements */
- /* [1] */
- 15, 5
- },
- { /* array: 1 elements */
- /* [1] */
- 20, 135
- }, sizeVariable, sizeVariable, shown, enabled,
- Popup {
- "TFixedPopup",
- 0b0,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {0, 0, 0, 0},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- 2001,
- 2, // longDate (match dateForm field in 'DATE' view, above)
- 50
- },
- /* [9] */
- 'PClu', 'pGLO',
- { /* array: 1 elements */
- /* [1] */
- 15, 145
- },
- { /* array: 1 elements */
- /* [1] */
- 20, 135
- }, sizeVariable, sizeVariable, shown, enabled,
- Popup {
- "TFixedPopup",
- 0b0,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {0, 0, 0, 0},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- 2002,
- 1, // shortDate (match defDateForm in ITestApplication)
- 50
- },
- /* [8] */
- 'DLOG', 'HOUR',
- { /* array: 1 elements */
- /* [1] */
- 150, 10
- },
- { /* array: 1 elements */
- /* [1] */
- 20, 250
- }, sizeFixed, sizeFixed, shown, enabled,
- CheckBox {
- "TCheckBox",
- 0b0,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {0, 0, 0, 0},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- off,
- "use a 24-hour clock (military time)"
- },
- /* [8] */
- 'DLOG', 'SECS',
- { /* array: 1 elements */
- /* [1] */
- 170, 10
- },
- { /* array: 1 elements */
- /* [1] */
- 20, 250
- }, sizeFixed, sizeFixed, shown, enabled,
- CheckBox {
- "TCheckBox",
- 0b0,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {0, 0, 0, 0},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- off,
- "display seconds"
- },
- /* [9] */
- 'DLOG', 'Vlid',
- { /* array: 1 elements */
- /* [1] */
- 40, 315
- },
- { /* array: 1 elements */
- /* [1] */
- 30, 90
- }, sizeFixed, sizeFixed, shown, enabled,
- CheckBox {
- "TCheckBox",
- 0b0,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {0, 0, 0, 0},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- off,
- "strict\nvalidation"
- },
- /* [9] */
- 'DLOG', 'rqur',
- { /* array: 1 elements */
- /* [1] */
- 75, 315
- },
- { /* array: 1 elements */
- /* [1] */
- 30, 90
- }, sizeFixed, sizeFixed, shown, enabled,
- CheckBox {
- "TCheckBox",
- 0b0,
- {1, 1},
- sizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- {0, 0, 0, 0},
- plain,
- 0,
- { /* array: 3 elements */
- /* [1] */
- 0x0,
- /* [2] */
- 0x0,
- /* [3] */
- 0x0
- },
- "",
- off,
- "must enter\nvalue"
- }
- }
- };
-
-